package com.xhu.water_supply.constants;

/**
 * 项目中用到的常量
 */
public class Constants {
    /**
     * jwt密钥
     */
    public final static String JWT_SECRET = "water-supply-jwt-secret";

    /**
     * 登录验证码密钥
     */
    public final static String JWT_SECRET_LOGIN = "water-supply-login-secret";
    /**
     * 访问来源--APP
     */
    public final static Integer SOURCE_TYPE_APP = 0;

    /**
     * 访问来源-PC
     */
    public final static Integer SOURCE_TYPE_PC = 1;
    /**
     * 本项目精确到的小数位数
     */
    public final static Integer DECIMAL_DIGITS = 2;
    /**
     * 手机号简单正则
     */
    public static String PHONE_REGSTR = "^[1][0-9]{10}$";
    /**
     * 密码正则
     */
    public static String PASSWORD_REGSTR = "^([A-Z]|[a-z]|[0-9]|[_]){6,10}$";

    public static class Redis{
        /** Redis中使用的公共前缀 */
        public final static String PREFIX = "FA";

        /** 短信前缀 */
        public final static String PREFIX_SMS = "sms:";
    }

    /**
     * 连接符
     */
    public static class Connnector{
        /**
         * 逗号
         */
        public final static String COMMA_ = ",";

        /**
         * 下划线
         */
        public final static String UNDERLINE = "_";

    }

    /**
     * 时长
     */
    public static class Duration{

        /**
         * 一秒
         */
        public final static Integer SECOND = 1;

        /**
         * 一分钟
         */
        public final static Integer MINUTE = SECOND * 60;

        /**
         * 半个小时
         */
        public final static Integer HALF_AN_HOUR = MINUTE * 30;

        /**
         * 一天
         */
        public final static Integer DAY = MINUTE * 60 * 24 ;
    }
}
